//
//  QuestionnaireViewController.m
//  HONGQIYUN
//
//  Created by 余海华 on 2016/12/19.
//  Copyright © 2016年 Haidi. All rights reserved.
//

#import "QuestionnaireViewController.h"

/// view
#import "HQYQuestionnaireCell.h"

static NSString *kQuestionnaireCellIndentifier = @"kQuestionnaireCellIndentifier";

const static CGFloat kQuestionnaireCellHeight = 200.f;

@interface QuestionnaireViewController () <UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UITableView *myTableView;

@property (nonatomic, strong) NSArray *dataArray;

@end

@implementation QuestionnaireViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)loadView {
    [super loadView];
    
    [self.myTableView setFrame:CGRectMake(0, 0, ScreenWidth, kScreenHeight - 64 - 49)];
    [self.view addSubview:self.myTableView];
}

#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    HQYQuestionnaireCell *cell = [tableView dequeueReusableCellWithIdentifier:kQuestionnaireCellIndentifier];
    
    if(cell == nil) {
        cell = [[HQYQuestionnaireCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kQuestionnaireCellIndentifier];
        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
    }
    
    return cell;
}

#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return kQuestionnaireCellHeight;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}

#pragma mark - lazy load
- (UITableView *)myTableView {
    if(!_myTableView) {
        _myTableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
        _myTableView.delegate = self;
        _myTableView.dataSource = self;
    }
    return _myTableView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
